#///////////////////////////////////////////////////////////////////////////////
##.. module:: source2doc
#
# A very simple wrapper script around :func:`file2doc` which iteratively
# documents the entire source directory. 
#  
# Configuration
# !!!!!!!!!!!!!
# Control inclusion / exclusion of files by adding glob patterns to 
# ``sources``
#
# Command-line usage
# !!!!!!!!!!!!!!!!!!
# ::
#
#   source source2doc
#
# .. warning::
#      File setup assumes that you are running from the head of the source
#      tree.
# 
# .. codeauthor:: Joe Kwiatkowski
##
#///////////////////////////////////////////////////////////////////////////////
# This looks backwards, but it's the only way I can get things to work.  In
# order for the glob pattern not to be expanded, you've got to break it...
sources="match_*.R match_*.py match_*.sh"
for source in $sources
do
    files=$(find . -name "${source#match_}"); # remove that pesky 'match'
    for file in $files
    do
        echo "$file"
        source file2doc.sh ${file#./}
    done
done
